package jbl.action;

import jbl.pageModel.Lb;
import jbl.service.LbServiceI;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.springframework.beans.factory.annotation.Autowired;

import com.opensymphony.xwork2.ModelDriven;

/**
 * @author jblcxg
 * 
 * 类别信息管理  快速添加类别信息
 *
 */
@Namespace("/")
@Action(value="lbAction")
public class LbAction extends BaseAction  implements ModelDriven<Lb>{
	private LbServiceI lbService;
	private Lb lb = new Lb();

	
	@Override
	public Lb getModel() {
		return lb;
	}
	@Autowired
	public void setlbService(LbServiceI lbService) {
		this.lbService = lbService;
	}
	/**
	 * 获取类别dataGrid
	 */
	public void dataGrid(){
		super.writeJson(lbService.dataGrid());	//发送到前端页面
	}
	/**
	 * 删除类别
	 */
	public void delete(){
		writeJson(lbService.delete(lb.getIds()));//更新到前端页面
	}
	/**
	 * 修改类别
	 */
	public void edit(){
		writeJson(lbService.edit(lb));//更新前端页面
		
	}
	/**
	 * 添加类别
	 */
	public void add(){
		writeJson(lbService.add(lb));
	}
	/**
	 * 获取类别下拉列表值
	 */
	public void comboboxInfo(){
		writeJson(lbService.comboboxInfo());
	}
}
